<template>
    <div id="app">
		<!-- <router-view/> -->
		<keep-alive>
            <router-view v-if="$route.meta.keepAlive&&isRouterAlive"></router-view>
        </keep-alive>
        <router-view  v-if="!$route.meta.keepAlive&&isRouterAlive"></router-view>
    </div>
</template>

<script>

export default {
	name: 'app',
    components: {},
    provide () {    //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。
        return {
            reload: this.reload
        }
    },
    data() {
        return{
            isRouterAlive: true                    //控制视图是否显示的变量
        }
    },
    methods: {
        reload () {
            this.isRouterAlive = false;            //先关闭，
            this.$nextTick(function () {
                this.isRouterAlive = true;         //再打开
            })
        }
    }
}
</script>

<style lang="scss">
	*,*:before,*:after{box-sizing: border-box;outline: none;}
    html,body{background: #fff;line-height: normal;position: relative;margin: 0 auto;height: inherit !important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;}
    ::-webkit-scrollbar{display: none;width: 0;}
    body{font-size: 24px;color: #333;-webkit-font-smoothing: antialiased;font-family: arial, sans-serif;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
    body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td,iframe{margin: 0;padding: 0;}
    img,article,aside,details,figcaption,figure,footer,header,menu,nav,section,summary,time,mark,audio{display: block;margin: 0;padding: 0;object-fit: cover}
    h1,h2,h3,h4,h5,h6,b{font-size: 100%;font-weight: normal;}
    fieldset,img{border: 0;}
    address,caption,cite,dfn,em,th,var,i,em{font-style: normal;font-weight: normal;}
    ol,ul{list-style: none;}
    a{text-decoration: none;color: inherit;}
    a:hover{text-decoration: none;}
    a,label,button,input,select,textarea{-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
    input[type=search]::-webkit-search-cancel-button{-webkit-appearance: none;}
    input,select,button{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;font: 100% arial, sans-serif, \5b8b\4f53;vertical-align: baseline;border: 0;border-radius: 0;background-color: transparent;-webkit-appearance: none;-moz-appearance: none;}
    button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border: none;}
    input[type=checkbox],input[type=radio]{vertical-align: middle;}
    input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance: none !important;-moz-appearance: none !important;margin: 0;}
    textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;outline: none;border-radius: 0;-webkit-appearance: none;-moz-appearance: none;overflow: auto;resize: none;font: 100% arial, sans-serif, \5b8b\4f53;}
    table{border-collapse: collapse;border-spacing: 0;}
    input::-moz-placeholder, textarea::-moz-placeholder{color: #ccc !important;}
    input:-ms-input-placeholder, textarea:-ms-input-placeholder{color: #ccc !important;}
    input::-webkit-input-placeholder, textarea::-webkit-input-placeholder{color: #ccc !important;}
    iframe{position: fixed;z-index: -1;}
    // 重置vant样式
    .van-nav-bar .van-icon,.van-search .van-icon{color: #333;font-weight: bold;}
    .van-search__content{background: #fff;padding-left: 0}
    .van-field__body{height: 32px;background: #F5F5F5;border-radius: 17px;padding: 0 15px}
    .van-search .van-icon-arrow-left{font-size: 16px;}
    .van-dropdown-menu{width: 40%;}
    .van-dropdown-menu__bar{height: auto;box-shadow:none;}
    .van-dropdown-menu__title{font-size: 14px;}
    .van-search{padding: 2px 0 0;}
    .van-search .van-icon-arrow-left{padding: 0 15px 0 16px;}
    .van-search .van-icon-clear{color: #999;font-weight: bold;}
    .van-search__action{padding-right: 15px;}
    .van-nav-bar__title{font-weight: bold;}
    .van-picker__confirm{color: #F42828}
    .van-index-bar__sidebar{transform: translateY(-40%)}
    .van-index-bar__index{font-size: 14px;line-height: 20px;}
    .van-checkbox__icon--checked .van-icon{background-color: #F42828;border-color: #F42828;}
    .van-index-anchor--sticky,.van-index-bar__index--active{color: #F42828}
  .circle_bg {
    position: absolute;
    width: 3500px;
    height: 3500px;
    left: 50%;
    margin-left: -1750px;
    border-radius: 50%;
    top: -3150px;
    background: #e54437;
  }
</style>
